class Animal {
    public String name;
    public int age;

    public Animal(String name,int age){
        this.name = name;
        this.age = age;
    }

    public void eat(){
        System.out.println(this.name+"正在吃饭！");
    }
}

class Dog extends Animal{
    public Dog(String name, int age){
        super(name,age);
    }

    public void eat(){
        System.out.println(this.name+"正在吃狗粮！");
    }

    public void bark(){
        System.out.println(this.name+"汪汪叫！");
    }
}

public class Test01{

    public static void main(String[] args) {
//        Animal animal = new Animal("大黄",18);
//        animal.eat();
//        Dog dog = new Dog("小黑",20);
//        dog.bark();
        Animal animal = new Dog("小黑",20);
        animal.eat();
    }
}
